package com.qf.service.impl;

import com.qf.entity.StatOrder;
import com.qf.mapper.OrderStatMapper;
import com.qf.service.IOrderStatService;
import com.qf.vo.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>title: com.qf.service.impl</p>
 * <p>Company: wendao</p>
 * author zhuximing
 * date 2021/9/24
 * description:
 */
@Service
public class OrderStatService  implements IOrderStatService {
    @Autowired
    private OrderStatMapper orderStatMapper;



    @Override
    public Result statOrderPerDay() {

        //统计
        StatOrder statOrder = orderStatMapper.statOrderInfoByPerDay();


        //保存

        orderStatMapper.saveStatRes(statOrder);


        return new Result(true, "success");
    }

    @Override
    public List<StatOrder> findStatOrderByDate(String start, String end) {
        return orderStatMapper.findStatOrderByDate(start, end);
    }
}